package com.atguigu.eduservice.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * @author abc
 * @version 1.0
 * @date 2021/3/8 14:29
 */
public class ExcelListener extends AnalysisEventListener<DemoData> {

    //一行一行的去读取excel的内容 不包括表头
    @Override
    public void invoke(DemoData data, AnalysisContext context) {
        System.out.println("****"+data.getSno()+"--->"+data.getSname());
    }

    //读取excel表头信息
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头信息："+headMap);
    }
    //读取之后的操作
    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {

    }
}
